package com.jason.demo.config;


import java.util.concurrent.atomic.AtomicInteger;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

@Configuration
@EnableScheduling	// 开启调度任务
public class CustomSchuldleConfig {
	private static AtomicInteger atomicInteger = new AtomicInteger();
	
	// 定义调度器(七子表达式)，每一分钟执行一次
	@Scheduled(cron = "0 0/1 * * * ?")
	public void printStr() {
		System.out.println("print str, " + atomicInteger.addAndGet(1));
	}
}
